package cc.comac.mom.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import cc.comac.mom.bean.BusLogSearch;
import cc.comac.mom.entity.BusLogEntity;


public interface BusLogDao {
	int existTable(String tableName);
	int dropTable(String tableName);
	/**
	 * 
	 * @param tableName 表名
	 * @param idName 主键名默认是表面+id(xx_log_id)
	 * @return
	 */
	int createTable(@Param(value = "tableName")String tableName,@Param(value = "idName")String idName);
	int save(@Param(value = "item")BusLogEntity busLogEntity,@Param(value = "tableName")String tableName,@Param(value = "idName")String idName);
	int saveBatch(@Param(value = "busLogs")List<BusLogEntity> busLogs,@Param(value = "tableName")String tableName,@Param(value = "idName")String idName);
	int delete(@Param(value = "id")long id,@Param(value = "tableName")String tableName,@Param(value = "idName")String idName);
	/**
	 * 
	 * @param leven 日志等级
	 * @param serviceName 服务名称
	 * @param category 分类
	 * @param clientIp客户端IP
	 * @param userName用户名
	 * @param startTime开始时间
	 * @param endTime结束时间
	 * @Desc 不传的直接写null，全部为null时删除所有
	 * @return 
	 */
	int deleteLog(@Param(value = "busLogSearch")BusLogSearch busLogSearch,@Param(value = "tableName")String tableName,@Param(value = "idName")String idName);
	BusLogEntity getById(@Param(value = "id")long id,@Param(value = "tableName")String tableName,@Param(value = "idName")String idName);
	/**
	 * 
	 * @param leven 日志等级
	 * @param serviceName 服务名称
	 * @param category 分类
	 * @param clientIp客户端IP
	 * @param userName用户名
	 * @param startTime开始时间
	 * @param endTime结束时间
	 * @Desc 不传的直接写null，全部为null时查询所有
	 * @return 
	 */
	List<BusLogEntity> getLogs(@Param(value = "busLogSearch")BusLogSearch busLogSearch,@Param(value = "tableName")String tableName,@Param(value = "idName")String idName);
	
}
